package com.mt.roll.wms.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mt.roll.core.base.BaseService;
import com.mt.roll.core.vo.PageVo;
import com.mt.roll.core.vo.R;
import com.mt.roll.wms.mapper.WmsToWcsVoMapper;
import com.mt.roll.wms.params.WmsToWcsQueryParam;
import com.mt.roll.wms.service.WmsToWcsService;
import com.mt.roll.wms.vo.WcsToWmsVo;
import com.mt.roll.wms.vo.WmsToWcsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class WmsToWcsServiceImpl extends BaseService implements WmsToWcsService {

    @Autowired
    private WmsToWcsVoMapper wmsToWcsVoMapper;

    @Override
    public R<PageVo<WmsToWcsVo>> page(WmsToWcsQueryParam wmsToWcsQueryParam) {
        IPage<WmsToWcsVo> wmsToWcsVoIPage = new Page<>(wmsToWcsQueryParam.getCurrent(),wmsToWcsQueryParam.getSize());
        IPage<WmsToWcsVo> page = wmsToWcsVoMapper.page(wmsToWcsVoIPage, wmsToWcsQueryParam);
        return successful(new PageVo<>(page,WmsToWcsVo.class));
    }
}
